home *** CD-ROM | disk | FTP | other *** search
/ Holt Researcher: American History / Holt Researcher: American History.iso / pc / modules / dbmap.dxr / 00024_save icon.ls < prev    next >
Encoding:
Text File  |  2000-01-27  |  1.2 KB  |  50 lines

  1. property ancestor, MinXLoc
  2. global gDBPictObjList
  3.  
  4. on new me, buttonName, castName, xSprite, xLoc, descendant
  5.   ancestor = new(script("generic Button"), buttonName, castName, xSprite, xLoc, me)
  6.   MinXLoc = getAt(xLoc, 1)
  7.   return me
  8. end
  9.  
  10. on performFunction me
  11.   tell the stage
  12.     playSFX(5)
  13.   end tell
  14.   MyObj = getaProp(gDBPictObjList, GetObjProp())
  15.   xMember = GetPictMember(MyObj)
  16.   put xMember
  17.   fExtension = GetArtExtension()
  18.   mFileName = member(xMember).name & fExtension
  19.   cFileName = member(xMember).name & "_cap" & fExtension
  20.   myPath = getSourcePath(1)
  21.   msFileName = myPath & mFileName
  22.   myPath = getSourcePath(0)
  23.   csFileName = myPath & cFileName
  24.   destPath = GetSavePathandName(mFileName)
  25.   put CopyFile(msFileName, destPath)
  26.   if sendSprite(15, #getStatus) then
  27.     destPath = GetSavePathandName(cFileName)
  28.     put CopyFile(csFileName, destPath)
  29.   end if
  30.   return me
  31. end
  32.  
  33. on getSourcePath isMap
  34.   if isMap then
  35.     sPath = "map"
  36.   else
  37.     sPath = "cap"
  38.   end if
  39.   if the machineType = 256 then
  40.     return "..\MEDIA\Maps\win\" & sPath & "\"
  41.   else
  42.     return the moviePath & ":MEDIA:Maps:mac:" & sPath & ":"
  43.   end if
  44. end
  45.  
  46. on buttonLoc me, size
  47.   set the locH of sprite the pChannel of me to getAt([MinXLoc, 613], size)
  48.   return me
  49. end
  50.